Skip to main content

📈 Performance Analysis

TL;DR

After the installing the Metis SDK to your code, every REST and SQL commands and their execution plan are sent to Metis servers for further analysis. Metis groups all the traces under the source Pull Request who generated them.

General

With Metis every CI test can generate performance insights. The flow of tests shows every REST call, SQL, Execution Plans, and their insights.

Our GitHub action enable Metis to group all the traces generated by a specific CI test using a special tag created using a GitHub Action.

How it works

Metis Git action add a special tag to the PR.

Like any other Rest and SQL commands on the SDK, Metis analyze them and based on their tagging, it group them together under the specific PR they originated from.

The Git action also will add a comment on the PR specifying that Metis analyzed the SQL commands generated by the tests.

Prerequisite

Installation

Link to the action in GitHub marketplace

Add the following code to your GitHub Actions workflow file:

- name: Metis Test
id: tag_pr
uses: metis-data/test-queries-analyzer@v1
with:
metis_api_key: ${{ secrets.METIS_API_KEY }}
github_token: ${{ secrets.GITHUB_TOKEN }}

Inject tag_pr in your env for your SDK usage

- name: E2E Test that check sql queries on real database
.
.
env:
METIS_TAG_PR: ${{ steps.tag_pr.outputs.pr_tag }}
.
.

Github workflow example

name: E2E-TEST-EXAMPLE

on:
# Run workflow every 6 hours
schedule:
- cron: '0 */6 * * *'

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend
steps:
- name: set TAG PR Value step
id: tag_pr
uses: metis-data/test-queries-analyzer@v1
with:
metis_api_key: ${{ secrets.METIS_API_KEY}}
github_token: ${{ secrets.GITHUB_TOKEN}}
- name: checkout
uses: actions/checkout@v3

- name: setup-node
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: test
env:
METIS_TAG_PR: ${{ steps.tag_pr.outputs.pr_tag }}
METIS_API_KEY: ${{ secrets.METIS_API_KEY}} #Optional
DATABASE_URL: ${{ secrets.METIS_E2E_DB_CONNECTION }} #Optional
# Run your e2e test
run: npm ci && npm run test-sql-queries